import { createRouter, createWebHistory } from "vue-router";
import homeIcon from "@/assets/image/home-icon.png";
import updateIcon from "@/assets/image/update-icon.png";
import queryIcon from "@/assets/image/query-icon.png";
import apiIcon from "@/assets/image/api-icon.png";
import login from "@/views/login/login.vue";
import home from "@/views/home/index.vue";

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    {
      path: '/login',
      name: 'login',
      component: login,
      // component: () => import('@/views/login/login.vue')
    },
    {
      path: "/home",
      name: "home",
      // component: () => import("@/views/home/index.vue"),
      component: home,
      meta: {
        title: "首頁",
        menuIndex: "0",
        icon: homeIcon,
      },
    },
    {
      path: "/sourceApplyApproval/:id",
      name: "sourceApplyApproval",
      component: () => import("@/views/sourceApplyApproval/index.vue"),
      meta: {
        title: "渠道申請審批",
        menuIndex: "1",
        icon: updateIcon,
      },
    },
    {
      path: "/detailOrderQuery",
      name: "detailOrderQuery",
      component: () => import("@/views/detailOrderQuery/index.vue"),
      meta: {
        title: "詳細訂單查詢",
        menuIndex: "2",
        icon: queryIcon,
      },
    },
    {
      path: "/merchantInfoUpdate/:id",
      name: "merchantInfoUpdate",
      component: () => import("@/views/merchantInfoUpdate/index.vue"),
      meta: {
        title: "商戶信息更新",
        menuIndex: "3",
        icon: updateIcon,
      },
    },
    {
      path: "/sourceApiSum",
      name: "sourceApiSum",
      component: () => import("@/views/sourceApiSum/index.vue"),
      meta: {
        title: "渠道接口匯總",
        menuIndex: "4",
        icon: apiIcon,
      },
    },
    {
      path: "/busiInfoQuery",
      name: "busiInfoQuery",
      component: () => import("@/views/busiInfoQuery/index.vue"),
      meta: {
        title: "商戶信息查詢",
        menuIndex: "5",
        icon: queryIcon,
      },
    },
    {
      path: "/busiWithdrawApproval",
      name: "busiWithdrawApproval",
      component: () => import("@/views/busiWithdrawApproval/index.vue"),
      meta: {
        title: "商戶提現審批",
        menuIndex: "6",
        icon: updateIcon,
      },
    },
    {
      path: "/busiAgentPayApproval",
      name: "busiAgentPayApproval",
      component: () => import("@/views/busiAgentPayApproval/index.vue"),
      meta: {
        title: "商戶代付審批",
        menuIndex: "7",
        icon: updateIcon,
      },
    },
  ],
});
export default router;
